// @Date         2021-11-17
// @Author       Aaron Zhang
// @Description
// @FileName      log_prefix.go

package formatter

import "zin/framework/contract"

// getLevelPrefix 根据级别 得到日志人前缀， 用来区分
func getLevelPrefix(level contract.LogLevel) string {
	switch level {
	case contract.LogLevelPanic:
		return "[panic]"
	case contract.LogLevelFalter:
		return "[falter]"
	case contract.LogLevelError:
		return "[error]"
	case contract.LogLevelWarn:
		return "[warn]"
	case contract.LogLevelInfo:
		return "[info]"
	case contract.LogLevelDebug:
		return "[debug]"
	case contract.LogLevelTrace:
		return "[trace]"
	default:
		return "[unknown]"
	}
}
